package ynu.edu.online_course.entity;

import jakarta.persistence.*;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Entity
@Table(name = "user_extension")
@Data
@NoArgsConstructor
public class UserExtension {
    @Id
    private Long userId;

    @MapsId
    @OneToOne
    @JoinColumn(name = "user_id")
    private User user;

    @OneToMany(mappedBy = "administrator",cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<Course> manageCourses;

    private int manageCourseCount;

    private Long totalWatchTime;

}
